Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run python autoformatter on entire Python libraries #770

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

rossdanlm
Copy link
Contributor

@rossdanlm rossdanlm commented Jan 5, 2024

Run python autoformatter on entire Python libraries

I just got tired of doing this manually every time. We should just eventually make a script to do this, can do later. Filed a task: #771

This includes the cookbooks

cc jonathan I couldn't just do a clean

fd --glob '*.py'  cookbooks/* | xargs python -m 'scripts.lint' --mode=fix --files

because there's an issue with llama extension:

rossdancraig@Rossdans-MBP aiconfig % fd --glob '*.py'  cookbooks/llama | xargs python -m 'scripts.lint' --mode=fix --files
Running autoflake
[Errno 2] No such file or directory: '/Users/jonathan/Projects/aiconfig/extensions/llama/python/llama.py'
Running isort
Broken 1 paths
Running black
Usage: black [OPTIONS] SRC ...
Try 'black -h' for help.

Error: Invalid value for 'SRC ...': Path '/Users/jonathan/Projects/aiconfig/extensions/llama/python/llama.py' does not exist.
[CRITICAL] 2024-01-05 01:58:04,022 lint.py:161: err: Some jobs failed:
OK:Oks:
Ok
stdout=''
stderr=''
Err:Errs:
Failure: exit code = 1
stdout=''
stderr=''
Failure: exit code = 2
stdout=''
stderr=''


Stack created with Sapling. Best reviewed with ReviewStack.

I just got tired of doing this manually every time. We should just eventually make a script to do this, can do later. Filed a task: #771

This includes the cookbooks

cc jonathan I couldn't just do a clean

```
fd --glob '*.py'  cookbooks/* | xargs python -m 'scripts.lint' --mode=fix --files
```

because there's an issue with llama extension:
```
rossdancraig@Rossdans-MBP aiconfig % fd --glob '*.py'  cookbooks/llama | xargs python -m 'scripts.lint' --mode=fix --files
Running autoflake
[Errno 2] No such file or directory: '/Users/jonathan/Projects/aiconfig/extensions/llama/python/llama.py'
Running isort
Broken 1 paths
Running black
Usage: black [OPTIONS] SRC ...
Try 'black -h' for help.

Error: Invalid value for 'SRC ...': Path '/Users/jonathan/Projects/aiconfig/extensions/llama/python/llama.py' does not exist.
[CRITICAL] 2024-01-05 01:58:04,022 lint.py:161: err: Some jobs failed:
OK:Oks:
Ok
stdout=''
stderr=''
Err:Errs:
Failure: exit code = 1
stdout=''
stderr=''
Failure: exit code = 2
stdout=''
stderr=''

```
@rossdanlm rossdanlm merged commit aa1eff3 into main Jan 5, 2024
2 checks passed
@rossdanlm rossdanlm deleted the pr770 branch January 5, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants